package com.gang.mars.redisson.Thread;

import java.util.concurrent.*;

public class Apple03Callable implements Callable<Boolean> {


    @Override
    public Boolean call() throws Exception {
        System.out.println("Callable invoke call...");
        return true;
    }

    public static void main(String[] args) {

        Apple03Callable appleCallable = new Apple03Callable();

        ExecutorService executorService = Executors.newFixedThreadPool(1);

        Future<Boolean> submit = executorService.submit(appleCallable);

        try {
            Boolean result = submit.get();

            System.out.println("result = " + result);
        }
        catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        finally {
            executorService.shutdownNow();
        }

    }
}
